Skip to content

fix(build): fix CA1305 error in SmtpEmailService Release build#22

Closed
Morgana-Claw wants to merge 3 commits intomasterfrom
develop
Closed

fix(build): fix CA1305 error in SmtpEmailService Release build#22
Morgana-Claw wants to merge 3 commits intomasterfrom
develop

Conversation

@Morgana-Claw
Copy link
Copy Markdown
Collaborator

@Morgana-Claw Morgana-Claw commented Apr 1, 2026

Problem

The Docker build on Render failed because SmtpEmailService.SendWelcomeEmailToUserAsync used int.Parse(string) without specifying CultureInfo.InvariantCulture.

In Directory.Build.props, TreatWarningsAsErrors is enabled for Release mode in non-test projects. The CA1305 analyzer warning became a build error.

Fix

Added CultureInfo.InvariantCulture to the int.Parse call in SendWelcomeEmailToUserAsync, consistent with how it was already done in SendWelcomeEmailAsync (line 12).

Verification

  • Debug build: 0 errors, 121 warnings (all naming conventions)
  • Release build: 0 errors, 35 warnings (all naming conventions)

- Add SendWelcomeEmailToUserAsync method to IEmailService interface
- Implement method in SmtpEmailService and SendGridEmailService with branded HTML template
- Inject IEmailService into AuthApplication and call it fire-and-forget after successful registration
- Email includes: congratulations message, next steps, ClientManager branding
- No PDF attachment (unlike customer welcome email)
- Update AuthApplicationTests to include IEmailService mock
…lService

CA1305 error in Release mode because int.Parse without IFormatProvider
varies by locale. This caused Docker build to fail on Render since
Directory.Build.props sets TreatWarningsAsErrors=true for Release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant